/*
 * NormalFavorableMessageListItem.java
 * business
 *
 * Created by ChenTao on 2017/1/10.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.data.bean.Message;
import com.yidiandao.business.ui.url.UrlActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.NormalFavorableMessageHolder;

/**
 * 常规促销信息-ListItem
 */
public class NormalFavorableMessageListItem extends DisplayListItem<NormalFavorableMessageHolder, Message> {

    public NormalFavorableMessageListItem(Message message) {
        super(message);
    }

    @Override
    public void onShow(final Context context, NormalFavorableMessageHolder holder) {
        holder.refreshUI(data);
        holder.rootLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                UrlActivity.actionStart((Activity) context, data.getUrl());
            }
        });
    }

    @Override
    public String getDisplayItemTag() {
        return NormalFavorableMessageListItem.class.getSimpleName();
    }

    @Override
    public Class<NormalFavorableMessageHolder> getViewHolderClazz() {
        return NormalFavorableMessageHolder.class;
    }
}
